//package com.kws.common.core.utils;
//
//import com.google.gson.Gson;
//import com.kuaidi100.sdk.api.QueryTrack;
//import com.kuaidi100.sdk.core.IBaseClient;
//import com.kuaidi100.sdk.pojo.HttpResult;
//import com.kuaidi100.sdk.request.QueryTrackParam;
//import com.kuaidi100.sdk.request.QueryTrackReq;
//import com.kuaidi100.sdk.utils.SignUtils;
//import com.kws.common.core.domain.QueryExpress100Rq;
//import com.kws.common.core.domain.info.Express100Info;
//import org.slf4j.Logger;
//import org.slf4j.LoggerFactory;
//import org.springframework.stereotype.Component;
//
///**
// * <b>ExpressDeliveryUtil</b>
// *
// * @description: ExpressDeliveryUtil <br>
// * @date: 2024/11/7 16:23 <br>
// * @author: lhm <br>
// * @version: 1.0 <br>
// */
//
//@Component
//public class ExpressDeliveryUtil {
//    private static final Logger logger = LoggerFactory.getLogger(ExpressDeliveryUtil.class);
//
//    public Express100Info queryExpressDelivery(QueryExpress100Rq rq){
//        Express100Info response = null;
//        QueryTrackReq queryTrackReq = new QueryTrackReq();
//        QueryTrackParam queryTrackParam = new QueryTrackParam();
//        queryTrackParam.setCom(rq.getCom());
//        queryTrackParam.setNum(rq.getNum());
//        queryTrackParam.setPhone(rq.getPhone());
//        queryTrackParam.setFrom(rq.getFrom());
//        queryTrackParam.setTo(rq.getTo());
//        queryTrackParam.setResultv2("2");
//        String param = new Gson().toJson(queryTrackParam);
//
//        queryTrackReq.setParam(param);
//        queryTrackReq.setCustomer(rq.getCustomer());
//        queryTrackReq.setSign(SignUtils.querySign(param ,rq.getKey(),rq.getCustomer()));
//
//        IBaseClient baseClient = new QueryTrack();
//        try {
//            HttpResult execute = baseClient.execute(queryTrackReq);
//            Gson gson = new Gson();
//            String responseBody = execute.getBody();
//            response = gson.fromJson(responseBody, Express100Info.class);
//            if ("200".equals(response.getStatus())){
//                return response;
//            }
//        } catch (Exception e) {
//            throw new RuntimeException(e);
//        }
//        return null;
//    }
//}
